@page "/Heatmap_Chart"
@inject NavigationManager NavigationManager
@inject HttpClient HttpClient

<Heatmap Config="config1" OnFirstRender="onChart1_FirstRender" />

<Divider>动手实验</Divider>
<DynamicExample @ref="@example">
    <Heatmap @ref="@chart" />
</DynamicExample>

@code{

    public IChartComponent chart;
    DynamicExample example;

    protected override void OnAfterRender(bool firstRender)
    {
        base.OnAfterRender(firstRender);
        example.Chart = chart;
    }


    #region 示例1

    private async Task onChart1_FirstRender(IChartComponent chart)
    {
        var data1 = await DemoData.BasementProdAsync(NavigationManager, HttpClient);
        await chart.ChangeData(data1);
    }

    HeatmapConfig config1 = new HeatmapConfig()
    {
        AutoFit = false,
        Width = 650,
        Height = 500,
        XField = "month_of_Year",
        YField = "district",
        ColorField = "aqhi",
        ShapeType = "rect",
        Color = new string[] { "#174c83", "#7eb6d4", "#efefeb", "#efa759", "#9b4d16" },
        Meta = new
        {
            Month_of_Year = new
            {
                Type = "cat",
            },
        },
    };


    #endregion 示例1
}

